const MeMongo = require("@mongodb/me/index")

class Server {

	constructor() {

	}

	/**
	 * 获取个人数据
	 * @returns {Promise<*>}
	 */
	static async get () {
		return await MeMongo.getMe()
	}

	/**
	 * 修改数据
	 * @param ctx
	 * @returns {Promise<*|IDBValidKey|void>}
	 */
	static async update (ctx) {
		return await MeMongo.update(ctx.vals)
	}
}

module.exports = Server
